home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_c
/
cuj0696.zip
/
DWYER.ZIP
/
LIB
/
ABRTGCLY.C
next >
Wrap
C/C++ Source or Header
|
1995-12-01
|
1KB
|
42 lines
/* ============ */
/* abrtgcly.c */
/* ============ */
#include <signal.h>
#include <stdlib.h>
/* ==================================================================== */
/* HaltProcess - Performs exit via AbortGracefully when ^C is Pressed */
/* ==================================================================== */
# if 0
# if defined(__STDC__) || defined(__PROTO__)
static void
HaltProcess(int unused)
# else
static void
HaltProcess(unused)
int unused;
# endif
{
if (unused || !unused)
exit(1);
}
# endif
/* ==================================================================== */
/* AbortGracefully - does the right thing at <CTRL> C or <CTRL> break */
/* ==================================================================== */
# if defined(__STDC__) || defined(__PROTO__)
void
AbortGracefully(void)
# else
void
AbortGracefully()
# endif
{
/* -------------------- */
/* Execute exit() on ^C */
/* -------------------- */
# if 0
signal(SIGINT, HaltProcess);
# endif
signal(SIGINT, exit);
}